﻿#ifndef UIMSETUP_H
#define UIMSETUP_H

#include <QWidget>
#include <QListWidgetItem>
#include <QCloseEvent>
#include <QMessageBox>
#include "fsConfig.h"
#include "uim.h"

#pragma execution_character_set("utf-8")

namespace Ui {
class UIMsetup;
}

class UIMsetup : public QWidget
{
    Q_OBJECT

public:
    explicit UIMsetup(QWidget *parent = nullptr , fsConfig *conf = nullptr, UIM *uim = nullptr, const QString msg = "电机参数配置");
    ~UIMsetup();

    void closeEvent(QCloseEvent *event);

    fsConfig *fsConf;
    UIM *fsUim;

    CONF_UIM_VAR *uimVar;
    QString title;
    void initUI(void);
    void setWin(int w,int h);
    bool isUimSave;

signals:
    void uimFlush(void);
    void uimSave(void);

private slots:
    void on_pushButtonFindGateway_clicked();
    void on_pushButtonSave_clicked();

    void on_checkBoxUSB_toggled(bool checked);
    void on_checkBoxCOM_toggled(bool checked);
    void on_checkBoxUimDebug_toggled(bool checked);

    void on_spinBoxNodeIdFocus_valueChanged(int arg1);
    void on_spinBoxCanRateFocus_valueChanged(int arg1);
    void on_spinBoxCanRateFocusLocate_valueChanged(int arg1);
    void on_spinBoxCanStepFocus_valueChanged(int arg1);
    void on_spinBoxCanStepFocusLocate_valueChanged(int arg1);
    void on_checkBoxCanFocusOrg_toggled(bool checked);
    void on_spinBoxCanFocusFar_valueChanged(int arg1);
    void on_spinBoxCanFocusLimit1_valueChanged(int arg1);
    void on_spinBoxCanFocusLimit2_valueChanged(int arg1);
    void on_checkBoxUimFocusMode_toggled(bool checked);

    void on_spinBoxNodeIdRight_valueChanged(int arg1);
    void on_spinBoxCanRateRight_valueChanged(int arg1);
    void on_spinBoxCanStepRight_valueChanged(int arg1);
    void on_spinBoxCanRateTakeupRight_valueChanged(int arg1);

    void on_spinBoxCanRatePhoto_valueChanged(int arg1);

    void on_checkBoxCanEncodeStop_toggled(bool checked);

private:
    Ui::UIMsetup *ui;
};

#endif // UIMSETUP_H
